package com.example.demo.design_pattern.template;

import org.junit.Test;

/**
 * @author xkx
 * @description 模板模式测试
 */
public class TemplateTest {

  @Test
  public void templateTest() {
    System.out.println("travel template one");
    AbstractTravelTemplate travelToShanghaiTemplate = new TravelToShanghaiTemplateImpl();
    travelToShanghaiTemplate.setNeedPrepare(false);
    travelToShanghaiTemplate.doTravel();
    System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
    System.out.println("travel template two");
    AbstractTravelTemplate travelToHangzhouTemplate = new TravelToHangzhouTemplateImpl();
    travelToHangzhouTemplate.doTravel();
  }
}
